<template>
  <div class="ArticleList-item">
    <van-cell v-for="item in list" :key="item.aut_id" :to="`/articleParticulars/${item.art_id}`" @click="demo($event)">
      <!-- 标题 -->
      <div slot="title" class="title van-multi-ellipsis--l2">
        {{ item.title }}
      </div>
      <!-- 内容图片 -->
      <div slot="label" class="label" v-if="item.cover.type === 3">
        <div class="images">
          <van-image
            :src="imgList"
            :key="index"
            v-for="(imgList, index) in item.cover.images"
            fit="cover"
            lazy-load
          />
        </div>
        <div class="label-info">

        </div>
      </div>
      <!-- 右侧图片 -->
      <div slot="default" class="images-right" v-if="item.cover.type === 1">
        <div :key="index" v-for="(imgList, index) in item.cover.images">
          <van-image fit="contain" :src="imgList" lazy-load />
        </div>
      </div>
      <!-- 文章信息 作者名字 发布时间等 -->
      <div slot="label" class="info">
          <div class="top ">
              置顶
          </div>
          <div class="authorName">
              {{item.aut_name }}
          </div>
          <div class="comment">
               {{item.comm_count}}
          </div>
         <div class="time">
             {{item.pubdate | formatDate}}
         </div>

      </div>
      <!-- 内容 -->
      <!-- <div slot="label">
        {{ item.title }}
      </div> -->
    </van-cell>
  </div>
</template>

<script>
import { setItem } from '@/utils/storage.js'
export default {
  data () {
    return {}
  },
  props: ['list', 'timestamp'],
  mounted () {
  },
  created () {
  },
  methods: {
    demo (e) {
      console.log(e)
      // 这里跟传递过来的差100不知道为什么 加100就行了
      setItem('history', this.timestamp + 100)
    }
  }
}
</script>

<style lang="less" scoped>
.ArticleList-item {
  .title {
    display: flex;
    flex: 1;
    font-size: 32px;
    color: #3a3a3a;
    line-height: 65px;
    height: 120px;
  }
  .images {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 146px;
    margin-bottom: 30px;
    /deep/.van-image {
      &:not(:last-child) {
          padding-right: 4px;
        }
      .van-image__img {
        max-width: 232px;
        height: 146px;
      }
    }
  }
  /deep/.van-cell__value {
    flex: unset;
  }
  .images-right {
    width: 232px;
    /deep/.van-image__img {
      display: flex;
      width: 232px;
      height: 146px;
    }
  }
  .info{
      font-size: 23px;
      color: #999999;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      .top{
          font-size: 26px;
          color: #E22829;
          font-weight: bold;
          margin-right: 16px;
      }
      .comment{
          margin: 0 20px;
      }
  }
}
</style>
